package com.smart.manager.member.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.smart.common.entities.ajax.AjaxResult;
import com.smart.common.entities.constant.SmartConstant;
import com.smart.common.entities.core.Page;
import com.smart.manager.member.entities.bodys.RMemberFriend;
import com.smart.manager.member.entities.models.MemberRelationFriend;
import com.smart.manager.member.repository.MemberFriendRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author Administrator
 */

@Api(tags = "会员账户")
@RestController
@RequestMapping(SmartConstant.MANAGER_API_PREFIX + "member/relation/friend")
@RequiredArgsConstructor
public class RelationFriendApi {

    private final MemberFriendRepository friendRepository;


    @GetMapping(value = "pageList")
    @ApiOperation(value = "查询好友关系")
    @SaCheckPermission("member:relation:friend:pageList")
    public AjaxResult<Page<MemberRelationFriend>> pageList(@Validated RMemberFriend.SearchBody body) {
        Page<MemberRelationFriend> result = friendRepository.pageList(body);
        return AjaxResult.data(result);
    }


}
